package net.maku.module.staff.vo;

import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;

import net.maku.framework.common.utils.DateUtils;
import net.maku.module.business.entity.DictionariesSubsetEntity;
import net.maku.module.organization.entity.OrganizationEntity;
import net.maku.module.organization.entity.PositionEntity;
import net.maku.module.organization.entity.WorkplaceEntity;

import java.util.Date;

/**
 * 业务_员工
 *
 * @author
 */
@Data
@Schema(description = "业务_员工")
public class StaffVO implements Serializable, TransPojo {
    private static final long serialVersionUID = 1L;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "编码")
    private String code;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Trans(type = TransType.SIMPLE, target = OrganizationEntity.class, fields = "abbreviation", ref = "organName")
    @Schema(description = "部门主键")
    private Long organizationId;
    private String organName;

    @Schema(description = "上级负责人")
    private Long superiorId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Trans(type = TransType.SIMPLE, target = PositionEntity.class, fields = "name", ref = "positionName")
    @Schema(description = "职位")
    private Long positionId;
    private String positionName;

    @Schema(description = "手机号码")
    private String phone;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Trans(type = TransType.SIMPLE, target = WorkplaceEntity.class, fields = "name", ref = "workplaceName")
    @Schema(description = "工作地点")
    private Long workplaceId;
    private String workplaceName;

    @Schema(description = "工作城市")
    private String workplaceStr;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Trans(type = TransType.SIMPLE, target = DictionariesSubsetEntity.class, fields = "name", ref = "typeName")
    @Schema(description = "员工类型")
    private Long type;
    private String typeName;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Trans(type = TransType.SIMPLE, target = DictionariesSubsetEntity.class, fields = "name", ref = "stateName")
    @Schema(description = "员工状态")
    private Long state;
    private String stateName;

    @Schema(description = "入职时间")
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    private Date hiredate;

    @Schema(description = "邮箱")
    private String postcode;

    @Schema(description = "是否启用")
    private Integer isEnable;

}